package com.hotkid.ceo.jetpack.myjetpackmvvm.base

import com.hotkid.ceo.jetpack.myjetpackmvvm.data.http.ApiException

class BaseBean<T>(private val errorCode:Int, private val data:T, private val errorMsg:String?) {
    fun code():Int{
       return if (errorCode==0) errorCode else throw ApiException(errorCode,errorMsg?:"")
    }

    fun data():T{
      return  if (errorCode==0) data else throw ApiException(errorCode,errorMsg?:"")
    }
}